#include <cstdio>
#include <algorithm>
using namespace std;
const int N=2*1e5+50;
const int INF=0x3f3f3f3f;
int a[N];
int h[N];
int num[N];
int cnt[N];
int pre[N];
int n,k;
int main(void){
    int maxH=0;
    int minH=INF;
    scanf("%d%d",&n,&k);
    for(int i=0;i<n;i++){
        scanf("%d",&h[i]);
        maxH=max(maxH,h[i]);
        minH=min(minH,h[i]);
        num[h[i]-1]++;
    }
    //特判
    if(minH==maxH){
        printf("0\n");
        return 0;
    }
    num[maxH]=0;
    //前缀和思想求出每一层的个数（需要删除的层）
    for(int i=maxH-1;i>=minH;i--){
        cnt[i]=cnt[i+1]+num[i];
    }
    int ans=1;
    int tmp=0;
    for(int i=1;i<=maxH;i++){
        if(tmp+cnt[i]<=k){
            tmp+=cnt[i];
        }
        else{
            ans++;
            tmp=cnt[i];
        }
    }
    printf("%d\n",ans);
    return 0;
}